#ifndef _AME_CONSOLE_CLIENT_H_
#define _AME_CONSOLE_CLIENT_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef struct packets {
	enum {
		PacketChatSystem = 0, // 00
		PacketChatNotice, // 01
		PacketChat, // 02
		PacketChatShout, // 03
		PacketChatPM, // 04
		PacketChatTrade,
		PacketChatParty,
		PacketChatGuild,
		PacketAuthRequest = 10,
		PacketAuthSuccess,
		PacketAuthDeny,
		PacketObjectLocated = 20,
		PacketObjectMovement,
		PacketObjectTrajectoryChange,
		PacketObjectDisappeared,
		PacketLookAroundRequest,
		PacketMapQuery,
		PacketCharselectCountRequest = 30,
		PacketCharInfoRequest,
		PacketCharselectRequest,
		PacketCharSelectedOK,
		PacketCharSelectedFailure,
		PacketCharDisplacement = 40,
		PacketUnknown
	} packet;
	char code;
	char sub_code;
	unsigned arguments: 4;
	unsigned length: 32; // In bytes
	int (*proc)(int, void *);
} NetPackets;

enum {
		WO_NONE = 0,
		WO_CHAR = 1,
		WO_MOB = 2,
		WO_ITEM = 3,
		WO_AE = 4
} WorldObjectType;

int parseChat(int packetnum, void *);
int finishPacket(int packetnum, void *);
int auth(int packetnum, void *);
int charSelect(int packetnum, void *);
int charDisplacement(int packetnum, void *p);
int selectRequest(int packetnum, void *p);
int objectLocated(int packetnum, void *p);
int mapQuery (int packetnum, void *p);
int info(int packetnum, void *p);

#ifdef __cplusplus
}
#endif

#endif
